import java.util.Scanner;

//找到字符串的最后一个单词,并返回这个单词的长度
public class LastChar {
    public static void main(String[] args) {
        Scanner in = new Scanner(System.in);
        while(in.hasNextLine()){
            String str = in.nextLine();
            int index = str.lastIndexOf(" ");
            String  ret = str.substring(index+1);
            System.out.println(ret.length());

        }
    }
}
